<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
    <title>滑动左右</title>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">

        $(function() {
            var startX, startY, endX, endY;
            var showADID = 1;
            document.getElementById("divADBox").addEventListener("touchstart", touchStart, false);
            document.getElementById("divADBox").addEventListener("touchmove", touchMove, false);
            document.getElementById("divADBox").addEventListener("touchend", touchEnd, false);
            function touchStart(event) {
                var touch = event.touches[0];
                startY = touch.payeY;
                startX = touch.pageX;
            }
            function touchMove(event) {
                var touch = event.touches[0];
//endY = (startY - touch.pageY);
                endX = touch.pageX;
            }
            function touchEnd(event) {
                $("#img0" + showADID).hide();
                showADID++;
                if (showADID > 4) {
                    showADID = 1;
                }
                if ((startX - endX) < 0) {
                    $("img0" + showADID).show();
                }

                $("#spText").html("X轴移动大小：" + (startX - endX));
            }



        });
    </script>
</head>
<body>
<form id="form1">
    <div style="border:solid 1px Red;" id="divADBox">
        <span id="spText">X轴移动大小：0</span>
        <img id="img01" src="DIV01.jpg" />
        <img id="img02" src="DIV02.jpg" style="display:none;" />
        <img id="img03" src="DIV03.jpg" style="display:none;" />
        <img id="img04" src="DIV04.jpg" style="display:none;" />
    </div>
</form>
</body>
</html>